package com.hq.zb.model;


import com.baomidou.mybatisplus.annotations.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

@Data
public abstract class BaseModel<T extends BaseModel> implements Serializable{
    /**
     * 是否删除y/n
     */
    @TableField("delete_flag")
    private Boolean deleteFlag;
    /**
     * 创建人id
     */
    @TableField("created_by")
    private Integer createdBy;
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField("creation_date")
    private Date creationDate;
    @TableField("last_updated_by")
    private Integer lastUpdatedBy;
    /**
     * 最后时间
     */
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField("last_update_date")
    private Date lastUpdateDate;

    /**
     * 系统
     */
    @TableField("sys_source")
    private String sysSource;

    /**
     * 主键值
     */
    protected abstract Serializable pkVal();
}
